package demo1;

interface Shape {
   /* public int a = 1;
    public static int b = 2;
    public static final int c = 3;*/

    int A = 1;
    int B = 2;
    int C = 3;

    void draw();
}

class Rect implements Shape {
    @Override
    public void draw() {
        System.out.println("矩形！");
    }
}

class Flower implements Shape {
    public void draw() {
        System.out.println("❀");
    }
}

public class Test2 {
    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        //demo1.Shape shape = new demo1.Shape();
        Shape shape1 = new Rect();
        Shape shape2 = new Flower();

        drawMap(shape1);
        drawMap(shape2);
        System.out.println("++++++++++++++++++++++++++++++");

        Shape[] shapes = {new Rect(),new Flower()};
        for(Shape shape:shapes){
            shape.draw();
        }
    }
}


